#!/usr/bin/make -f
# -*- makefile -*-

# This rules file is for new Nokia devices using maemo6/meego.
# For fremantle / N900 see the file devices/maemo5/debian/rules.
# For ubuntu desktop see the file devices/ubuntu/debian/rules.

# To build using this rules file:
# #
# ### install debian packaging stuff if not already present:
# sudo apt-get install dpkg-dev debhelper cdbs
#
# ### set up the build directory with version number - DO NOT CD INTO IT YET!
# mkdir quick3d-tp1
#
# ### copy all the stuff across - cannot shadow build (probably don't want git)
# (cd ~/depot/qt/quick3d && tar cf - --exclude-vcs .)|(cd quick3d-tp1 && tar xf -)
#
# ### if the qmake in the $PATH is not the Qt you want to use
# ### you can use a binary package or a Qt built from source (even if its installed with
# ### "make install") as long as it has declarative & opengl
# # export PATH=/usr/local/Qt-%VERSION%/bin:$PATH
#
# cd quick3d-tp1
# export DEB_BUILD_OPTIONS="parallel=4"
# dpkg-buildpackage -b

# Uncomment this to turn on verbose mode.
export DH_OPTIONS=-v
export DH_VERBOSE=1

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk

# Find out how many parallel threads to run 
TMP_BUILD_OPTS = $(subst $(comma),$(space),$(DEB_BUILD_OPTIONS))
ifneq (,$(filter parallel=%,$(TMP_BUILD_OPTS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(TMP_BUILD_OPTS)))
	PARALLEL_MAKEFLAGS += -j$(NUMJOBS)
endif

DEB_MAKE_INVOKE := $(MAKE) $(PARALLEL_MAKEFLAGS)
DEB_MAKE_INSTALL_TARGET := INSTALL_ROOT=$(DEB_DESTDIR) install
DEB_DH_INSTALL_SOURCEDIR := debian/tmp

common-configure-arch::
	qmake -spec linux-g++-maemo quick3d.pro CONFIG+=maemo CONFIG+=package
